module.exports = function(app) {

	// server routes ===========================================================
	// handle things like api calls
	// authentication routes

	// frontend routes =========================================================
	// route to handle all angular requests
	var Menu = require('./controllers/menu.server.controller.js');
    var orders = require('./controllers/order.server.controller');
    var shop = require('./controllers/shop.server.controller');
    var member = require('./controllers/member.server.controller');

	//菜单页面数据接口
	app.route('/api/getMenu').get(Menu.getMenu);//获取菜单
	// app.route('/api/imgUpload').post(Menu.imgUpload); //上传图片
	app.route('/api/editMenu').post(Menu.editMenu);//编辑菜单
	app.route('/api/addDishes').post(Menu.addDishes); //新增菜品
	app.route('/api/deleteItem/:goods_id').delete(Menu.deleteItem);
	app.route('/api/getType').get(Menu.getType) //获取菜单类型
	app.route('/api/addType').post(Menu.addType); //新增菜单类型
	app.route('/api/deleteType/:type_id').delete(Menu.deleteType);//删除菜单类型
	// app.route('/api/editItem/:item_name').put(Meau.editItem);
	// app.route('/api/deleteType').delete(Meau.deleteType);//删除菜单类型
	// app.route('/api/addType').post(Meau.addType);//添加菜单类型

	//订单数据接口
	// app.route('/api/getOrders').get(orders.getOrders);
	app.route('/api/getOrders').get(orders.getOrders);//获取订单
	app.route('/api/generateOrders').post(orders.generateOrders);//生成订单
	// app.route()

	// 店铺数据接口
	app.route('/api/saveShopdata').post(shop.saveShopdata);
	app.route('/api/imgUploadMeng').post(shop.imgUpload);//上传图片

	// 会员数据接口
	// app.route('/api/addMember').post(member.addMember);//添加会员
	app.route('/api/updateMember').post(member.updateMember);//更新会员
	app.route('/api/deleteMember').delete(member.deleteMember);//删除会员
};